package business;

import java.util.List;

import dao.IUserDAO;
import dao.JDBCUserDAO;
import domain.User;
import domain.VideoUser;

public class BusinessUser {
	
	public static List<User> getAllUser(){
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getAllUser();
	}
	
	public static User getUserByLogin(String login){
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getUserByLogin(login);
		
	}
	
	public static String getNameById(Integer idUser){
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getNameById(idUser);
		
	}
		
	public static List<User> getAllUserByName(String name){
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getAllUserByName(name);
	}
	
	public static User getUserById(Integer id){
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getUserById(id);
	}
	
	public static String getLoginById(Integer idUser){
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getLoginById(idUser);
	}
	
	public static List<VideoUser> getVideosUsersOrderByDateDesc()
	{
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getVideosUsersOrderByDateDesc();		
	}

	public static List<User> getAllUserByNameYearGenre(String name,
			Integer year, String genre) {
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getAllUserByNameYearGenre(name,year,genre);
	}

	public static List<User> getAllUserByNameYear(String name, Integer year) {
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getAllUserByNameYear(name, year);
	}

	public static List<User> getAllUserByNameGenre(String name, String genre) {
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getAllUserByNameGenre(name, genre);
	}

	public static List<User> getAllUserByYearGenre(Integer year, String genre) {
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getAllUserByYearGenre(year,genre);
	}

	public static List<User> getAllUserByYear(Integer year) {
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getAllUserByYear(year);
	}

	public static List<User> getAllUserByGenre(String genre) {
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getAllUserByGenre(genre);
	}
	
	public static boolean createAcount(User usuario)
	{
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.createAcount(usuario);
		
	}

	public static boolean addFriend(Integer idUser, Integer idUserAdd) {
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.addFriend(idUser,idUserAdd);

	}
	
	public static List<Integer> getInvitations(Integer idUser)
	{
		IUserDAO userDAO = new JDBCUserDAO();
		return userDAO.getInvitations(idUser);
	}
}